<template>
	<view class="img" v-if="shopDetail.BusinessLicense">
		<image :src="shopDetail.BusinessLicense" mode="aspectFill"></image>
	</view>
	<view class="img" v-else-if="imgStatus==1">
		<!-- <image class="imgElse" src="../../../static/static/nopic.png" mode="widthFix"></image> -->
	</view>
</template>

<script>
	import { getShopBgDetail } from '@/api/mall.js'
	
	export default {
		components: {
			
		},
		data() {
			return {
				
				shopId:'',
				shopDetail:'',
				imgStatus:'',
				
				
			}
		},
		onLoad(e) {
			
			this.shopId = e.id
			this.getShop(e)
		},
		methods:{
			async getShop(e){
				
				try{
					uni.showLoading({
						title:'加载中...'
					})
					const { Data } = await getShopBgDetail({
						Id:e.id
					})
					this.shopDetail = Data
					if(!Data.BusinessLicense){
						this.imgStatus = 1
					}
					uni.hideLoading()
					
				}catch(e){
					//TODO handle the exception
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.img{
		width: 100%;
		min-height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		image{
			width: 80%;
			height:80vh;
		}
		// .imgElse{
		// 	width: 100;
			
		// }
	}
	
</style>
